package com.itheima.mapper;

import com.itheima.entity.DishFlavor;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface DishFlavorMapper {

    void saveBatch(@Param("flavors") List<DishFlavor> flavors);

    @Select("select * from dish_flavor where dish_id=#{dishId} ")
    List<DishFlavor> findById(long id);



    //根据菜品口味一个id删除口味
    @Delete("delete from dish_flavor where dish_id=#{id} ")
    void deleteFlavoeByDishId(Long id);
    //根据菜品口味的多个id删除口味
    void deleteFlavoeByDishIds(@Param("ids") List<Long> ids);
}
